<?php

/*
 * 商城命令行基类
 */

namespace app\admin\command;

use think\console\Command;

abstract class Base extends Command
{

    //需要显示的日志，step,error,sql,info
    protected $outputLog = ['step', 'error'];

    //显示日志
    protected function _showLog($log, $type = 'info')
    {
        if (in_array($type, $this->outputLog)) {
            $log = "[" . date("Y-m-d H:i:s") . "][" . $type . "]" . $log;
            if ($type === 'error') {
                echo $this->output->error($log);
            } else {
                echo $this->output->highlight($log);
            }
        }
    }

}
